package com.xywang.controller;

import com.alibaba.fastjson.JSONArray;
import com.xywang.dao.role.RoleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/jsp")
public class RoleController {
    private RoleDao roleDaoImpl;
    @Autowired
    public void setRoleDaoImpl(RoleDao roleDaoImpl) {
        this.roleDaoImpl = roleDaoImpl;
    }
    @RequestMapping("/getRoleList")
    @ResponseBody
    public String getRoleList(){
        System.out.println(JSONArray.toJSONString(roleDaoImpl.getRoleListDao()));
        return JSONArray.toJSONString(roleDaoImpl.getRoleListDao());
    }
}
